var ajaxHelper = require("../../utils/ajaxhelp");
const serviceUrl = getApp().globalData.serviceUrl;
let token = wx.getStorageSync('token');

const GetHospital = () => {
	token = wx.getStorageSync('token');
	return ajaxHelper.promiseRequst(serviceUrl + "/api/hospital/Get", {
		'Authorization': 'Bearer ' + token
	}, "GET", null)
}

const GetDepartmentByHospitalId = (hospitalId) => {
	token = wx.getStorageSync('token');
	return ajaxHelper.promiseRequst(serviceUrl + "/api/Department/GetDepartmentByHospitalId", {
		'Authorization': 'Bearer ' + token
	}, "GET", {
		hospitalId: hospitalId
	})
}

module.exports = {
	GetHospital,
	GetDepartmentByHospitalId
}
